package com.dog.basics.admin.controller.mtkj;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dog.basics.bean.dto.admin.mtkj.CashWithdrawalEditDto;
import com.dog.basics.bean.dto.admin.mtkj.CashWithdrawalFromDto;
import com.dog.basics.bean.dto.admin.mtkj.HospitalFromDto;
import com.dog.basics.bean.dto.admin.mtkj.OrderComplaintStatusDto;
import com.dog.basics.bean.vo.admin.mtkj.CashWithdrawalVo;
import com.dog.basics.bean.vo.admin.mtkj.HospitalVo;
import com.dog.basics.common.annotation.SysLog;
import com.dog.basics.common.util.PageParam;
import com.dog.basics.common.util.R;
import com.dog.basics.service.mtkj.IMtCashWithdrawalService;
import com.dog.basics.service.mtkj.IMtCashWithdrawalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 提现记录 前端控制器
 * </p>
 *
 * @author wph
 * @since 2020-11-09
 */
@RestController
@RequestMapping("/pc/cash/withdrawal")
@Api(value = "提现记录模块", tags = "提现记录模块")
@AllArgsConstructor
public class MtCashWithdrawalController {
    private final IMtCashWithdrawalService mtCashWithdrawalService;

    /**
     * @Description: 提现列表
     * @Param: HospitalFromDto
     * @return: IPage<HospitalVo>
     * @Author: wph
     * @Date:
     */
    @ApiOperation(value = "提现列表", notes = "pc:mtCashWithdrawal:page")
    @GetMapping("/page")
    @PreAuthorize("@pms.hasPermission('pc:mtCashWithdrawal:page')")
    public R<IPage<CashWithdrawalVo>> page(PageParam page, CashWithdrawalFromDto obj) {
        IPage<CashWithdrawalVo> list = mtCashWithdrawalService.getPageList(page, obj);
        return R.ok(list);
    }

    /**
     * @Description: 审核提现记录
     * @Param: ApiBankAccountAddDto
     * @return: Boolean
     * @Author: wph
     * @Date: 2020/05/29  0027
     */
    @SysLog("审核提现记录")
    @ApiOperation(value = "审核提现记录", notes = "pc:mtCashWithdrawal:editObj")
    @PreAuthorize("@pms.hasPermission('pc:mtCashWithdrawal:editObj')")
    @PutMapping
    public R<Boolean> editFeedback(@RequestBody @Valid CashWithdrawalEditDto dto) {
        return R.ok(mtCashWithdrawalService.editObj(dto));
    }
}
